from packet import Packet

class DataPacket(Packet):
    """
    The data packet.
    """
    def __init__(self, src_node_id, dst_node_id, data, packet_size):
        """
        Constructor.
        """
        Packet.__init__(self, src_node_id, dst_node_id, packet_size)
        self._data = data

    def get_data(self):
        """
        Returns the data contained in this packet.
        """
        return self._data
        
    def __repr__(self):
        return "(DataPacket: %d, %d, %d, %d)" % (self._src_node_id, self._dst_node_id, self._data, self._packet_size)
